<?php /*a:2:{s:71:"D:\laragon\www\jiaqueshop\application\manage\view\point_orders_add.html";i:1564044550;s:59:"D:\laragon\www\jiaqueshop\application\manage\view\base.html";i:1596192950;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
	<meta name="renderer" content="webkit">
<title>后台管理系统</title>
<link rel="stylesheet" href="/static/public/awesome/css/font-awesome.min.css" />

<link rel="stylesheet" href="/static/public/layui/css/layui.css" />

<link rel="stylesheet" href="/static/public/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="/static/manage/css/style.css" />

	<link rel="stylesheet" href="/static/public/dist/zoomify.min.css">
	
<script src="/static/public/kindeditor/kindeditor-all.js"></script>
<script src="/static/public/kindeditor/lang/zh_CN.js"></script>
<script src="/static/public/ueditor/ueditor.config.js?t=<?php echo time();?>"></script>
<script src="/static/public/ueditor/ueditor.all.min.js"></script>
<script src="/static/public/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<?php if($is_auth): ?>

<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="<?php echo url('index/welcome'); ?>"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>商城</span>
            <span class="icon-angle-right"></span>
            <span>积分订单管理</span>
            <span class="icon-angle-right"></span>
            <span>积分订单详情</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <div class="m-form">
                <form class="layui-form" id="j_form">
                    <table class="m-table">
                        <thead>
                            <tr>
                                <th colspan="4">查看积分订单详情</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td width="15%"><label>订单 ID</label></td>
                                <td width="35%"><?php echo htmlentities($info['id']); ?></td>
                                <td width="15%"><label>订单编号</label></td>
                                <td width="35%"><?php echo htmlentities($info['order_no']); ?></td>
                            </tr>
                            <tr>
                                <td width="15%"><label>下单会员</label></td>
                                <td width="35%"><?php echo htmlentities($info['username']); ?></td>
                                <td width="15%"><label>收货人</label></td>
                                <td width="35%"><?php echo htmlentities($info['receiver_name']); ?></td>
                            </tr>
                            <tr>
                                <td width="15%"><label>收货人联系方式</label></td>
                                <td width="35%"><?php echo htmlentities($info['receiver_mobile']); ?></td>
                                <td width="15%"><label>收货人地址</label></td>
                                <td width="35%"><?php echo htmlentities($info['receiver_province']); ?><?php echo htmlentities($info['receiver_city']); ?><?php echo htmlentities($info['receiver_district']); ?><?php echo htmlentities($info['receiver_address']); ?></td>
                            </tr>
                            <tr>
                            	<td width="15%"><label>订单所需我只要</label></td>
                                <td width="35%"><?php echo htmlentities($info['points']); ?></td>
                                <td width="15%"><label>实付积分</label></td>
                                <td width="35%"><?php echo htmlentities($info['pay_amount']); ?></td>
                            </tr>
                            <tr>
                            	<td width="15%"><label>快递单号</label></td>
                                <td width="35%"><?php echo htmlentities($info['courier']); ?></td>
                                <td width="15%"><label>订单状态</label></td>
                                <td width="35%" data-id="<?php echo htmlentities($info['id']); ?>" data-status-id="<?php echo htmlentities($info['order_status_id']); ?>" class="m-order-action">
                                    <?php echo htmlentities($info['order_status_txt']); if($info['order_status_id'] == 0): ?>
                                    <!-- 待确认 -->
                                    <a data-order-status="1">确认订单</a>
                                    <?php elseif($info['order_status_id'] == 1): ?>
                                    <!-- 已确认 -->
                                    <?php elseif($info['order_status_id'] == 2): ?>
                                    <!-- 已取消 -->
                                    <?php elseif($info['order_status_id'] == 3): ?>
                                    <!-- 已关闭 -->
                                    <?php elseif($info['order_status_id'] == 4): ?>
                                    <!-- 待付款 -->
                                    <a data-pay-status="1">确认收款</a>
                                    <?php elseif($info['order_status_id'] == 5): ?>
                                    <!-- 待发货 -->
                                    <a data-shipping-status="1">确认发货</a>
                                    <?php elseif($info['order_status_id'] == 6): ?>
                                    <!-- 待收货 -->
                                    <a data-shipping-status="2">确认收货</a>
                                    <?php elseif($info['order_status_id'] == 7): ?>
                                    <!-- 申请退货 -->
                                    <a data-shipping-status="3">同意退货</a>
                                    <?php elseif($info['order_status_id'] == 8): ?>
                                    <!-- 退货中 -->
                                    <a data-shipping-status="4">确认退货</a>
                                    <?php elseif($info['order_status_id'] == 9): ?>
                                    <!-- 已退货 -->
                                    <?php elseif($info['order_status_id'] == 10): ?>
                                    <!-- 申请退款 -->
                                    <a data-pay-status="2">同意退款</a><a data-pay-status="3">取消退款</a>
                                    <?php elseif($info['order_status_id'] == 11): ?>
                                    <!-- 退款中 -->
                                    <a data-pay-status="4">确认退款</a>
                                    <?php elseif($info['order_status_id'] == 12): ?>
                                    <!-- 拒绝退款 -->
                                    <?php elseif($info['order_status_id'] == 13): ?>
                                    <!-- 已退款 -->
                                    <?php elseif($info['order_status_id'] == 14): ?>
                                    <!-- 已收货 -->
                                    <?php elseif($info['order_status_id'] == 15): ?>
                                    <!-- 已完成 -->
                                    <?php endif; ?>
                                </td>
                                
                            </tr>
                            <tr>
                                <td width="15%"><label>兑换时间</label></td>
                                <td width="35%"><?php echo htmlentities($info['pay_time_date']); ?></td>
                                <td width="15%"><label>发货时间</label></td>
                                <td width="35%"><?php echo htmlentities($info['send_time_date']); ?></td>
                            </tr>
                            <tr>
                                <td width="15%"><label>签收时间</label></td>
                                <td width="35%"><?php echo htmlentities($info['sign_time_date']); ?></td>
                                <td width="15%"><label>订单完成时间</label></td>
                                <td width="35%"><?php echo htmlentities($info['finish_time_date']); ?></td>
                            </tr>
                        </tbody>
                        <thead>
                            <tr>
                                <th colspan="4">订单商品</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td colspan="4">
                                    <table class="m-table m-fields">
                                        <thead>
                                            <tr>
                                                <th width="70%">商品名称</th>
                                                <th width="10%">支付积分</th>
                                                <th width="10%">数量</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                         
                                            <?php if(is_array($info['goods_list']) || $info['goods_list'] instanceof \think\Collection || $info['goods_list'] instanceof \think\Paginator): if( count($info['goods_list'])==0 ) : echo "" ;else: foreach($info['goods_list'] as $key=>$v): ?>
                                            <tr>
                                                <td><?php echo htmlentities($v['goods_name']); ?></td>
                                                <td><?php echo htmlentities($v['point']); ?></td>
                                                <td><?php echo htmlentities($v['goods_nums']); ?></td>
                                            </tr>
                                            <?php endforeach; endif; else: echo "" ;endif; ?>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
    </div>
    <style>
    #masklll{width:100%;height:100%;position:fixed;background:rgba(0,0,0,0.3);display:none}
	#masklll div{width:300px;height:200px;position:absolute;left:0;right:0;bottom:0;top:0;margin:auto;background:#fff}
    #masklll .title{text-align:center;line-height:50px;font-size:16px}
	#masklll input{width:200px;margin:20px auto;line-height:40px}
	#masklll ul{width:100%;position:absolute;bottom:0;left:0}
	#masklll ul li{width:50%;float:left;line-height:40px;text-align:center;background:#ddd}
    </style>
    <div id='masklll'>
    	<div>
    		<p class='title'>请输入快递单号</p>
    		<input type='text' id='wenxintishi' value='' style='display:block'>
    		<input type='hidden' id='shipping_status' value=''>
    		<input type='hidden' id='ids' value=''>
    		<input type='hidden' id='order_status' value=''>
    		<input type='hidden' id='pay_status' value=''>
    		<ul>
    			<li class='queding' style='background:#c00;color:#fff' onclick='queding()'>确定</li>
    			<li class='quxiao' onclick='quxiao()'>取消</li>
    		</ul>
    	</div>
    </div>
</div>

<?php endif; ?>
<input type="hidden" name="action_uri" value="<?php echo url('action'); ?>" />

<input type="hidden" name="redirect_uri" value="<?php echo url('index'); ?>" />

<input type="hidden" name="region_uri" value="/manage/regions/regions" />
<script src="/static/public/js/jquery-1.10.2.js"></script>
<script src="/static/public/js/maniac.ui.js"></script>
<script src="/static/public/layui/layui.js" charset="utf-8"></script>
<script src="/static/public/js/aes.js"></script>
<script src="/static/public/js/mode-ecb-min.js"></script>
<script src="/static/public/js/utils.js"></script>
<script src="/static/public/js/dialog.js"></script>
<script src="/static/manage/js/form.js"></script>
<script src="/static/manage/js/js.js"></script>
<script src="/static/public/js/app.js"></script>
<script src="/static/public/js/encrypt.js"></script>
<script src="/static/public/dist/zoomify.min.js"></script>
<script type="text/javascript">
    $('.fdzoom').zoomify();
</script>

<script>
var aesKey = '<?php echo htmlentities($encrypt_key); ?>';
    $(function(){
        layui.use('layer', function(){
            var user_exists = parseInt('<?php echo !empty($user_exists) ? 1  :  0; ?>');
            var user_forbidden = parseInt('<?php echo !empty($user_forbidden) ? 1  :  0; ?>');
            var quit_force = parseInt('<?php echo !empty($quit_force) ? 1  :  0; ?>');
            var is_auth    = parseInt('<?php echo !empty($is_auth) ? 1  :  0; ?>');
            
            if (user_exists) {
                dialog.error('您所登录的用户已被删除', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (user_forbidden) {
                dialog.error('您的账户已被禁用', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }

            if (quit_force) {
                dialog.error('同一账户同一时间只能一人在线', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (!is_auth) {
                dialog.error('您没有权限执行此操作', function(){
                    window.location.href = history.go(-1);
                    return false;
                });
            }
        });
    })
</script>

<script>
    $(function(){
        $('.m-order-action a').on('click', function(){
            var id              = $(this).parent().attr('data-id');
            var order_status    = $(this).attr('data-order-status');
            var pay_status      = $(this).attr('data-pay-status');
            var shipping_status = $(this).attr('data-shipping-status');
            var status = {
                id: id
            };
            if (typeof(order_status) !== "undefined") {
                status.order_status = order_status;
            }
            if (typeof(pay_status) !== "undefined") {
                status.pay_status = pay_status;
            }
            if (typeof(shipping_status) !== "undefined") {
                status.shipping_status = shipping_status;
            }
            if(shipping_status == 1){
            	$('#shipping_status').val(shipping_status)
            	$('#ids').val(id)
            	$('#masklll').show();
            	
            }else{
            	layer.confirm('您确定要执行此操作吗？', {
                    btn: ['确定', '取消']
                }, function(){
                    $.post('<?php echo url("orderAction"); ?>', status, function(ret){
                        if (ret.status == 0) {
                            dialog.success(ret.message, function(){
                                window.location.reload();
                            });
                        } else {
                            dialog.error(ret.message);
                        }
                    }, 'json');
                }, function(){
                    
                });
            }
            //询问框
            
        });
        
        
    })
    function queding(){
    	var statuse = {
                id: $('#ids').val(),
                value: $('#wenxintishi').val(),
                
        };
    	if (typeof($('#shipping_status').val()) != "undefined") {
        	statuse.shipping_status = $('#shipping_status').val();
        }
    	console.log(statuse)
    	$.post('<?php echo url("orderAction"); ?>', statuse, function(ret){
                        if (ret.status == 0) {
                            dialog.success(ret.message, function(){
                                window.location.reload();
                            });
                        } else {
                            dialog.error(ret.message);
                        }
                    }, 'json');
    	quxiao()
    }
	function quxiao(){
		$('#masklll').hide();
    }
</script>

</body>
</html>